package com.yang.pojo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;


@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@TableName("user")  //使用mybatis-plus时用@TableName注解指定该对象对应的数据库表名
public class User {

    /*
    *   利用@TableFiled注解
    *          1) 指定Java属性与数据库哪个字段对应:
    *               @TableFiled(value="表字段名")
    *
    *          2) 指定某个字段是否存在与数据库:
    *               @TableFiled(exist=false)
    */
    private Long id;
    private String name;
    @TableField(value = "gender")
    private Integer gender;
    @TableField(exist = false)
    private String address;
    private String username;
    private String password;
    private Boolean isAdmin;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
}
